<template>
	<view class="flex-column" style="width: calc(100vw - 32px); margin-left: 16px; margin-top: 15px;">
		<view class="flex-column font-weight-regular" style="color: #313C56;">
			<text class="font-14">追加悬赏</text>
			<view class="flex-row flex-items-center font-16" style="margin-top: 12px;">
				<view v-for="(item,index) in ['否', '是']" :key="index" class="flex-row flex-items-center" style="margin-right: 48px;" @click="rewardIndex = index">
					<image :src="`/static/select${rewardIndex == index ? 'ed' : ''}.png`" style="width: 16px; height: 16px; margin-right: 4px;"></image>
					<text>{{ item }}</text>
				</view>
			</view>
			<view
				style=" width: calc(100%); height: 1px; background-color: #F7F9FD; margin-top: 8px;">
			</view>
		</view>
		<publish-item v-if="rewardIndex==1" title="追加悬赏" unit="SPX" :value="rewardSpx"
			requisite @inputEnd="(e) => {rewardSpx = e}"></publish-item>
		<view class="flex-column font-weight-regular" style="color: #313C56; margin-top: 8px;">
			<text class="font-14">是否让用户缴纳保证金</text>
			<view class="flex-row flex-items-center font-16" style="margin-top: 12px;">
				<view v-for="(item,index) in ['否', '是']" :key="index" class="flex-row flex-items-center" style="margin-right: 48px;" @click="earnestIndex = index">
					<image :src="`/static/select${earnestIndex == index ? 'ed' : ''}.png`" style="width: 16px; height: 16px; margin-right: 4px;"></image>
					<text>{{ item }}</text>
				</view>
			</view>
			<view
				style=" width: calc(100%); height: 1px; background-color: #F7F9FD; margin-top: 8px;">
			</view>
		</view>
		<publish-item v-if="earnestIndex==1" title="用户保证金额" unit="USDT" :value="digitalEarnest"
			requisite @inputEnd="(e) => {digitalEarnest = e}"></publish-item>
	</view>
</template>

<script>
	import publishItem from "@/components/publish-item/publish-item.vue"

	export default {
		name:"task-reward",
		components: {
			publishItem
		},
		data() {
			return {
				// 悬赏
				rewardIndex: 0,
				//  保证金
				earnestIndex: 0,
				// selectIcon: require('/static/selected.png')
				digitalEarnest: '',
				rewardSpx: ''
				
			};
		},
		methods: {
			getParmas() {
				const params = {rewardSpx: '', digitalEarnest: ''}
				if (this.rewardIndex == 1) {
					params.rewardSpx = this.rewardSpx
				}
				if (this.earnestIndex == 1) {
					params.digitalEarnest = this.digitalEarnest
				}
				return params
			}
		}
	}
</script>

<style>

</style>